import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class SocketClient {
    public static void main(String[] args) {
            try {
                Socket socket = new Socket("127.0.0.1",4444);
                socket.setSendBufferSize(200);

                OutputStream outputStream = socket.getOutputStream();
                InputStream inputStream = socket.getInputStream();
                int cout = 0;
                for (int i = 0; i < 60000; i++) {

                    try {

                        byte[] bytes = "1".getBytes();

                        outputStream.write(bytes);
                        cout = cout + bytes.length;
                        System.out.println(cout);

                        outputStream.flush();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
                Thread.sleep(200000);


            } catch (Exception e) {
                e.printStackTrace();
            }
    }
}
